function checkCategoryForm()
{
    var category_name = $.trim($('#category_name').val());
    if(category_name == ''){ alert('请输入分类名称'); return false; }
    return true;
}

function categoryStatus(id, st)
{
    if( ! confirm('确认？')){ return; }
    $.ajax({
        url:'/admin/article/ajax_category_st',
        data:({'id':id, 'st':st}),
        type:'post',
        dataType:'json',
        success:function(msg){
            if(msg.st != 'y'){
                alert(msg);
            }
            rl();
        },
        error:function(){
            alert('网络繁忙，请稍后重试');
        }
    });
}

function articleStatus(id, st)
{
    if( ! confirm('确认？')){ return; }
    $.ajax({
        url:'/admin/article/ajax_st',
        data:({'id':id, 'st':st}),
        type:'post',
        success:function(msg){
            if(msg.st != 'y'){
                alert(msg.note);
            }
            rl();
        },
        error:function(){
            alert('网络繁忙，请稍后重试');
        }
    });
}

function checkForm()
{
    var cid = $.trim($('#cid').val());
    cid = parseInt(cid);
    if(isNaN(cid) || cid<1){ alert('请选择分类'); return false; }

    var title = $.trim($('#title').val());
    if(title == ''){ alert('文章标题必须填写'); return false; }

    var author = $.trim($('#author').val());
    if(author == ''){ alert('文章作者必须填写'); return false; }

    var content = $.trim($('#content').val());
    if(content == ''){ alert('文章内容必须填写'); return false; }

    return true;
}